package com.atguigu.CmsService.controller;

import com.atguigu.CmsService.entity.CrmBanner;
import com.atguigu.CmsService.service.CrmBannerService;
import com.atguigu.commonutils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/eduCms/bannerFront")
//@CrossOrigin
public class BannerFrontController {
    @Resource
    private CrmBannerService bannerService;

    @ApiOperation(value = "查询前两条banner")
    @GetMapping("getAllBanner")
    public R index() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("bannerList", list);
    }
}
